<?php
/**
 * 入库单
 *
 * @category 
 * @package 
 * @author chenping<chenping@shopex.cn>
 * @version $Id: Z
 */
class erpapi_wms_matrix_ilc_response_stockin extends erpapi_wms_response_stockin
{

    public function status_update($params){
        $params = parent::status_update($params);
        
        // 解决编号中带“+” 问题
        if($params['io_bn'] == 'I64056051 64056052') $params['io_bn'] = str_replace(' ','+',trim($params['io_bn']));

        if ($params['items']){
            foreach ((array) $params['items'] as $key=>$item){
                $barcode = $item['bn'] ? $item['bn'] : $item['product_bn'];

                // 条码转货号
                if ($barcode) {
                    $bn = kernel::single('material_codebase')->getBnBybarcode($barcode);
                    $params['items'][$key]['bn'] = $params['items'][$key]['product_bn'] = $bn ? $bn : $barcode;    
                }
            }
        }

        return $params;
    }
}
